-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Validations for equals()
and not_equals()
#1952
Add Validations for equals()
and not_equals()
#1952
Conversation
Please provide the unit test case related to all the datatype and string case sensitive and insensitive comparison. |
Could not we just use in_list / not_in_list / regex rules ? |
@nowackipawel While those supply overlapping functionality, they make for weird error messages such as "The confirmation field must be one of: yes." This allows for clearer messages as well as easier to understand code. |
I accidentally sent user guide and tests to my develop branch. I included those and added tests for case sensitivity. Data types are irrelevant because rules "must accept a string as the first parameter" (https://codeigniter4.github.io/CodeIgniter4/libraries/validation.html#creating-custom-rules). |
Null gets cast as empty string so is actually true, even though the datatypes are initially different.
Description
Per conversation in Slack, there is currently no way to check a precise value (or not), such as confirming a user typed "yes". This adds validation rules for
equals
andnot_equals
, along with their language texts, user guide entires, and tests.Checklist: